from Common.BaseForm import BaseForm, IntegerField, StringField, TextAreaField, DataRequired, EqualTo


class AccountDeleteForm(BaseForm):
    id = IntegerField('id', validators=[DataRequired()])


class AccountPutForm(BaseForm):
    id = IntegerField('id', validators=[DataRequired()])
    newpwd = StringField('newpwd', validators=[DataRequired()])
    verpwd = StringField('verpwd', validators=[DataRequired(), EqualTo('newpwd')])


class RolePostForm(BaseForm):
    name = StringField('name', validators=[DataRequired()])
    desc = TextAreaField('desc')


class RolePutForm(BaseForm):
    id = IntegerField('id', validators=[DataRequired()])
    name = StringField('name', validators=[DataRequired()])
    desc = TextAreaField('desc')


class RoleDeleteForm(BaseForm):
    id = IntegerField('id', validators=[DataRequired()])
